<script lang="ts" setup>
import { computed, ref } from 'vue';

const money = ref(10000)

// 完整写法
// const doubleHappy = computed<number>(() => money.value * 2)
// 省略写法，建议
// const doubleHappy = computed(() => money.value * 2)

const doubleHappy = computed({
    get() { return money.value * 2 },
    set() { }
})
console.log(' -----> ', doubleHappy.value);
</script>

<template>
    <div>我是vue3-ts - {{doubleHappy}}</div>
</template>